<template>
    <div class="mcr-wrap wrapper" ref="wrapper3">
        <div class="content">
            <MainClassifyRTop></MainClassifyRTop>
            <MainClassifyRDown></MainClassifyRDown>
        </div>
    </div>
</template>

<script>
import Bscroll from "better-scroll";

import MainClassifyRTop from "./MainClassifyRTop"
import MainClassifyRDown from "./MainClassifyRDown"
export default {
    data(){
        return {
            scroll:null
        }
    },
    computed:{
        showImages(){
            return this.$store.getters.classifyRTopImages;
        }
    },
    watch:{
        showImages(){
            this.scroll.scrollTo(0,0,700,"bounce");
        }
    },
    components:{
        MainClassifyRTop,
        MainClassifyRDown
    },
    mounted() {
        this.bscrollInit();
    },
    methods: {
        bscrollInit() {
            console.log(this,"2222");
            this.$nextTick(() => {
                if (!this.scroll) {
                    this.scroll = new Bscroll(this.$refs.wrapper3, {
                        click: true
                    });
                } else {
                    this.scroll.refresh();
                }
            });
        }
    }
  
}
</script>

<style lang="less">
.mcr-wrap{
    width:100%;
    height:100%;
}
</style>